# define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int n, i, s = 1, m = 0;
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
    {
        s *= i; m += s;
    }
    printf("%d", m);
    return 0;
}
